package info.opensoaring.api;

import java.io.Serializable;
import java.util.Date;

public class Flight implements Serializable {

    private static final long serialVersionUID = -90459824867889613L;

    private String hash;

    private Date creationTime;

    private Date lastUpdate;

    private Date startTime;

    private Date finishTime;

    private User owner;

    private Club club;

    private String igcFlight;

    public Flight() {

    }

    public Flight(String hash) {
	this.hash = hash;
    }

    public Flight(String hash, Date creationTime, Date lastUpdate, Date startTime, Date finishTime,
	    User owner, Club club, String igcFlight) {
	this.hash = hash;
	this.creationTime = creationTime;
	this.lastUpdate = lastUpdate;
	this.startTime = startTime;
	this.finishTime = finishTime;
	this.owner = owner;
	this.club = club;
	this.igcFlight = igcFlight;
    }

    public String getHash() {
	return hash;
    }

    public void setHash(String hash) {
	this.hash = hash;
    }

    public Date getCreationTime() {
	return creationTime;
    }

    public void setCreationTime(Date creationTime) {
	this.creationTime = creationTime;
    }

    public Date getLastUpdate() {
	return lastUpdate;
    }

    public void setLastUpdate(Date lastUpdate) {
	this.lastUpdate = lastUpdate;
    }

    public Date getStartTime() {
	return startTime;
    }

    public void setStartTime(Date startTime) {
	this.startTime = startTime;
    }

    public Date getFinishTime() {
	return finishTime;
    }

    public void setFinishTime(Date finishTime) {
	this.finishTime = finishTime;
    }

    public User getOwner() {
	return owner;
    }

    public void setOwner(User owner) {
	this.owner = owner;
    }

    public Club getClub() {
	return club;
    }

    public void setClub(Club club) {
	this.club = club;
    }

    public String getIgcFile() {
	return igcFlight;
    }

    public void setIgcFlight(String igcFlight) {
	this.igcFlight = igcFlight;
    }

    public String toString() {
	return "{Hash=" + hash + ",Creation=" + creationTime + ",Update=" + lastUpdate + ",Start="
		+ startTime + ",Finish=" + finishTime + ",Owner=" + owner + ",Club=" + club
		+ ",IgcFlight(size)=" + (igcFlight != null ? igcFlight.length() : "") + "}";
    }
}
